Hardware device drivers are often implemented within the kernel of an operating system of a computer in order to have easy access to hardware resources of the computer, particularly interrupts generated by particular hardware devices. Since it is sometimes desirable to implement hardware device drivers within user space rather than within the kernel (e.g., to protect against system crashes), some developers have implemented these hardware device drivers partially within the user space, relying on interrupt service routines (ISRs) within the kernel to notify the hardware device drivers of the appropriate interrupts.
While it can be difficult to communicate from kernel space to user space, some approaches allow communication from kernel space to user space by using an intermediate RAM-based file system (e.g., Procfs, Sysfs, Configfs, etc.). In such systems, the kernel space ISR writes to the RAM-based file system when an interrupt is processed, and the user space driver periodically polls the RAM-based file system for changes.
Other approaches use blocking system calls to communicate from kernel space to user space. In such systems, a user space driver sends a system call to the kernel. The user space driver then goes to sleep until it receives a response to the system call with information from the kernel ISR. The kernel only responds to the system call when a kernel ISR is ready to issue the next interrupt.